﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PrintStringsAsHex
{
    class PrintStringsAsHex
    {
        public static void PrintStringAsHex(string str)
        {
            byte[] strBytes= Encoding.UTF8.GetBytes(str);

            foreach (var strByte in strBytes)
            {
                Console.Write("\\x{0}",strByte);
            }
            
        }

        static void Main(string[] args)
        {
            PrintStringAsHex("Hi!");
        }
    }
}
